POV-Ray : Newsgroups : povray.newusers : single point on spline and a vector: comparison : single point on spline and a vector: comparison Server Time
29 Jul 2024 04:22:20 EDT (-0400)
  single point on spline and a vector: comparison  
From: marabou
Date: 2 Nov 2006 13:47:29
Message: <454a3d41@news.povray.org>
hello,
for some reason I want to check if one point at spline-creation time is
equal to one point in an array.
More concrete:
There is an array[] of vectors which holds points of one future spline. 
A macro creates a spline from it. While this macro creates spline I wish to
compare if actual processed point hits one predefined point from array[x].

pseudo-code:
>>>>>>>>>>>>>>>>>>>>>>>>
// define spline
#declare splinepoints = array[]{<x,y,z>,...}

// create spline
#declare splinepath = spline{cubic_spline #while...}

// draw balls on splinepath
#macro happyspline(splinepath)
        #while (clock_counter <= maxpoint)
                sphere {
                        splinepath(clock_counter), radius
                }
                // the comparison, which fails:
                #if ( splinepath(clock_counter) = splinepoints[10] )
                        "HIT"
                #end
                clock_counter += anystep
        #end //while
#end //macro
<<<<<<<<<<<<<<<<<<<<<<<<<

Then comes a parse error: "Float expected but vector or color expression
found."
And I ask: Why is splinepath(at_one_moment) no vector? What did I wrong?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.